home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Technology Seed / ATS July '97.toast / Mac OS 8 / Docs-Interfaces-Libs / Appearance Manager / Appearance.p < prev    next >
Encoding:
Text File  |  1997-06-10  |  67.7 KB  |  1,636 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Appearance.p
  3.  
  4.      Contains:    Appearance Manager APIs
  5.  
  6.      Version:    Technology:    Appearance 1.0
  7.                  Release:    Tempo
  8.  
  9.      Copyright:    © 1984-1997 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Appearance;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __APPEARANCE__}
  28. {$SETC __APPEARANCE__ := 1}
  29.  
  30. {$I+}
  31. {$SETC AppearanceIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QUICKDRAW__}
  35. {$I Quickdraw.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __WINDOWS__}
  41. {$I Windows.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __DIALOGS__}
  44. {$I Dialogs.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __FILES__}
  47. {$I Files.p}
  48. {$ENDC}
  49. {$IFC UNDEFINED __ICONS__}
  50. {$I Icons.p}
  51. {$ENDC}
  52. {$IFC UNDEFINED __CONTROLS__}
  53. {$I Controls.p}
  54. {$ENDC}
  55. {$IFC UNDEFINED __TEXTEDIT__}
  56. {$I TextEdit.p}
  57. {$ENDC}
  58. {$IFC UNDEFINED __QDOFFSCREEN__}
  59. {$I QDOffscreen.p}
  60. {$ENDC}
  61.  
  62. {$PUSH}
  63. {$ALIGN MAC68K}
  64. {$LibExport+}
  65.  
  66.  
  67. TYPE
  68.     TextEncoding                        = UInt32;
  69. { —————————————————————————————————————————————————————————————————————————————————— }
  70. {  Appearance Manager constants, etc.                                                 }
  71. { —————————————————————————————————————————————————————————————————————————————————— }
  72.  
  73. CONST
  74.                                                                 {  Appearance Trap Number  }
  75.     _AppearanceDispatch            = $AA74;
  76.  
  77. {  Gestalt selector and values for the Appearance Manager  }
  78.     gestaltAppearanceAttr        = 'appr';
  79.     gestaltAppearanceExists        = 0;
  80.     gestaltAppearanceCompatMode    = 1;
  81.  
  82. {  Appearance Manager Error Codes  }
  83.     appearanceBadBrushIndexErr    = -30560;                        {  pattern index invalid  }
  84.     appearanceProcessRegisteredErr = -30561;
  85.     appearanceProcessNotRegisteredErr = -30562;
  86.     appearanceBadTextColorIndexErr = -30563;
  87.  
  88.     kThemeActiveDialogBackgroundBrush = 1;                        {  Dialogs  }
  89.     kThemeInactiveDialogBackgroundBrush = 2;                    {  Dialogs  }
  90.     kThemeActiveAlertBackgroundBrush = 3;
  91.     kThemeInactiveAlertBackgroundBrush = 4;
  92.     kThemeActiveModelessDialogBackgroundBrush = 5;
  93.     kThemeInactiveModelessDialogBackgroundBrush = 6;
  94.     kThemeActiveUtilityWindowBackgroundBrush = 7;                {  Miscellaneous  }
  95.     kThemeInactiveUtilityWindowBackgroundBrush = 8;                {  Miscellaneous  }
  96.     kThemeListViewSortColumnBackgroundBrush = 9;                {  Finder  }
  97.     kThemeListViewBackgroundBrush = 10;
  98.     kThemeIconLabelBackgroundBrush = 11;
  99.     kThemeListViewSeparatorBrush = 12;
  100.     kThemeChasingArrowsBrush    = 13;
  101.     kThemeDragHiliteBrush        = 14;
  102.     kThemeDocumentWindowBackgroundBrush = 15;
  103.     kThemeFinderWindowBackgroundBrush = 16;
  104.  
  105.  
  106. TYPE
  107.     ThemeBrush                            = SInt16;
  108.  
  109. CONST
  110.     kThemeActiveDialogTextColor    = 1;                            {  Dialogs  }
  111.     kThemeInactiveDialogTextColor = 2;
  112.     kThemeActiveAlertTextColor    = 3;
  113.     kThemeInactiveAlertTextColor = 4;
  114.     kThemeActiveModelessDialogTextColor = 5;
  115.     kThemeInactiveModelessDialogTextColor = 6;
  116.     kThemeActiveWindowHeaderTextColor = 7;                        {  Primitives  }
  117.     kThemeInactiveWindowHeaderTextColor = 8;
  118.     kThemeActivePlacardTextColor = 9;                            {  Primitives  }
  119.     kThemeInactivePlacardTextColor = 10;
  120.     kThemePressedPlacardTextColor = 11;
  121.     kThemeActivePushButtonTextColor = 12;                        {  Primitives  }
  122.     kThemeInactivePushButtonTextColor = 13;
  123.     kThemePressedPushButtonTextColor = 14;
  124.     kThemeActiveBevelButtonTextColor = 15;                        {  Primitives  }
  125.     kThemeInactiveBevelButtonTextColor = 16;
  126.     kThemePressedBevelButtonTextColor = 17;
  127.     kThemeActivePopupButtonTextColor = 18;                        {  Primitives  }
  128.     kThemeInactivePopupButtonTextColor = 19;
  129.     kThemePressedPopupButtonTextColor = 20;
  130.     kThemeIconLabelTextColor    = 21;                            {  Finder  }
  131.     kThemeListViewTextColor        = 22;
  132.  
  133.  
  134. TYPE
  135.     ThemeTextColor                        = SInt16;
  136. {  States to draw primitives: disabled, active, and pressed (hilited)  }
  137.  
  138. CONST
  139.     kThemeStateDisabled            = 0;
  140.     kThemeStateActive            = 1;
  141.     kThemeStatePressed            = 2;
  142.  
  143.  
  144. TYPE
  145.     ThemeDrawState                        = UInt32;
  146. { —————————————————————————————————————————————————————————————————————————————————— }
  147. {  Window Manager constants, etc.                                                     }
  148. { —————————————————————————————————————————————————————————————————————————————————— }
  149.  
  150. CONST
  151.                                                                 {  Resource IDs for new window defprocs  }
  152.     kWindowDocumentDefProcResID    = 64;
  153.     kWindowDialogDefProcResID    = 65;
  154.     kWindowUtilityDefProcResID    = 66;
  155.     kWindowUtilitySideTitleDefProcResID = 67;
  156.  
  157.                                                                 {  Proc IDs for theme-savvy windows  }
  158.     kWindowDocumentProc            = 1024;
  159.     kWindowGrowDocumentProc        = 1025;
  160.     kWindowVertZoomDocumentProc    = 1026;
  161.     kWindowVertZoomGrowDocumentProc = 1027;
  162.     kWindowHorizZoomDocumentProc = 1028;
  163.     kWindowHorizZoomGrowDocumentProc = 1029;
  164.     kWindowFullZoomDocumentProc    = 1030;
  165.     kWindowFullZoomGrowDocumentProc = 1031;
  166.  
  167.                                                                 {  Proc IDs for theme-savvy dialogs  }
  168.     kWindowPlainDialogProc        = 1040;
  169.     kWindowShadowDialogProc        = 1041;
  170.     kWindowModalDialogProc        = 1042;
  171.     kWindowMovableModalDialogProc = 1043;
  172.     kWindowAlertProc            = 1044;
  173.     kWindowMovableAlertProc        = 1045;
  174.  
  175.                                                                 {  Proc IDs for top title bar theme-savvy floating windows  }
  176.     kWindowFloatProc            = 1057;
  177.     kWindowFloatGrowProc        = 1059;
  178.     kWindowFloatVertZoomProc    = 1061;
  179.     kWindowFloatVertZoomGrowProc = 1063;
  180.     kWindowFloatHorizZoomProc    = 1065;
  181.     kWindowFloatHorizZoomGrowProc = 1067;
  182.     kWindowFloatFullZoomProc    = 1069;
  183.     kWindowFloatFullZoomGrowProc = 1071;
  184.  
  185.                                                                 {  Proc IDs for side title bar theme-savvy floating windows  }
  186.     kWindowFloatSideProcID        = 1073;
  187.     kWindowFloatSideGrowProcID    = 1075;
  188.     kWindowFloatSideVertZoomProcID = 1077;
  189.     kWindowFloatSideVertZoomGrowProcID = 1079;
  190.     kWindowFloatSideHorizZoomProcID = 1081;
  191.     kWindowFloatSideHorizZoomGrowProcID = 1083;
  192.     kWindowFloatSideFullZoomProcID = 1085;
  193.     kWindowFloatSideFullZoomGrowProcID = 1087;
  194.  
  195.                                                                 {  Region values to pass into GetWindowRegion  }
  196.     kWindowTitleBarRgn            = 0;
  197.     kWindowTitleTextRgn            = 1;
  198.     kWindowCloseBoxRgn            = 2;
  199.     kWindowZoomBoxRgn            = 3;
  200.     kWindowDragRgn                = 5;
  201.     kWindowGrowRgn                = 6;
  202.     kWindowCollapseBoxRgn        = 7;
  203.     kWindowStructureRgn            = 32;
  204.     kWindowContentRgn            = 33;
  205.  
  206.  
  207. TYPE
  208.     WindowRegionCode                    = UInt16;
  209.  
  210. CONST
  211.                                                                 {  Window Features returned by GetWindowFeatures  }
  212.     kWindowCanGrow                = $01;
  213.     kWindowCanZoom                = $02;
  214.     kWindowCanCollapse            = $04;
  215.     kWindowIsModal                = $08;
  216.     kWindowCanGetWindowRegion    = $10;
  217.     kWindowIsAlert                = $20;
  218.     kWindowHasTitleBar            = $40;
  219.  
  220.                                                                 {  New window messages  }
  221.     kWindowMsgGetFeatures        = 7;
  222.     kWindowMsgGetRegion            = 8;
  223.  
  224.                                                                 {  New Window part codes  }
  225.     inCollapseBox                = 11;
  226.  
  227.                                                                 {  Window Definition hit test result codes ("WindowPart") }
  228.     wInCollapseBox                = 9;
  229.  
  230. {  Window positioning constants  }
  231.     kWindowDefaultPosition        = $0000;
  232.     kWindowCenterMainScreen        = $280A;
  233.     kWindowAlertPositionMainScreen = $300A;
  234.     kWindowStaggerMainScreen    = $380A;
  235.     kWindowCenterParentWindow    = $A80A;
  236.     kWindowAlertPositionParentWindow = $B00A;
  237.     kWindowStaggerParentWindow    = $B80A;
  238.     kWindowCenterParentWindowScreen = $680A;
  239.     kWindowAlertPositionParentWindowScreen = $700A;
  240.     kWindowStaggerParentWindowScreen = $780A;
  241.  
  242. {  GetWindowRegionRec - used for WDEF calls with kWindowMsgGetRegion  }
  243.  
  244. TYPE
  245.     GetWindowRegionRecPtr = ^GetWindowRegionRec;
  246.     GetWindowRegionRec = RECORD
  247.         winRgn:                    RgnHandle;
  248.         regionCode:                WindowRegionCode;
  249.     END;
  250.  
  251.     GetWindowRegionPtr                    = ^GetWindowRegionRec;
  252. { —————————————————————————————————————————————————————————————————————————————————— }
  253. {  Dialog Manager constants, etc.                                                     }
  254. { —————————————————————————————————————————————————————————————————————————————————— }
  255.  
  256. CONST
  257.                                                                 {  Alert types to pass into StandardAlert  }
  258.     kAlertStopAlert                = 0;
  259.     kAlertNoteAlert                = 1;
  260.     kAlertCautionAlert            = 2;
  261.     kAlertPlainAlert            = 3;
  262.  
  263.  
  264. TYPE
  265.     AlertType                            = SInt16;
  266.  
  267. CONST
  268.     kAlertDefaultOKText            = -1;                            {  "OK" }
  269.     kAlertDefaultCancelText        = -1;                            {  "Cancel" }
  270.     kAlertDefaultOtherText        = -1;                            {  "Don't Save" }
  271.  
  272. {  StandardAlert alert button numbers  }
  273.     kAlertStdAlertOKButton        = 1;
  274.     kAlertStdAlertCancelButton    = 2;
  275.     kAlertStdAlertOtherButton    = 3;
  276.     kAlertStdAlertHelpButton    = 4;
  277.  
  278.                                                                 {  Dialog Flags for use in NewFeaturesDialog or dlgx resource  }
  279.     kDialogFlagsUseThemeBackground = $01;
  280.     kDialogFlagsUseControlHierarchy = $02;
  281.     kDialogFlagsHandleMovableModal = $04;
  282.     kDialogFlagsUseThemeControls = $08;
  283.  
  284.                                                                 {  Alert Flags for use in alrx resource  }
  285.     kAlertFlagsUseThemeBackground = $01;
  286.     kAlertFlagsUseControlHierarchy = $02;
  287.     kAlertFlagsAlertIsMovable    = $04;
  288.     kAlertFlagsUseThemeControls    = $08;
  289.  
  290. {  For dftb resource  }
  291.     kDialogFontNoFontStyle        = 0;
  292.     kDialogFontUseFontMask        = $0001;
  293.     kDialogFontUseFaceMask        = $0002;
  294.     kDialogFontUseSizeMask        = $0004;
  295.     kDialogFontUseForeColorMask    = $0008;
  296.     kDialogFontUseBackColorMask    = $0010;
  297.     kDialogFontUseModeMask        = $0020;
  298.     kDialogFontUseJustMask        = $0040;
  299.     kDialogFontUseAllMask        = $00FF;
  300.     kDialogFontAddFontSizeMask    = $0100;
  301.     kDialogFontUseFontMaskMask    = $0200;
  302.  
  303.  
  304. TYPE
  305.     AlertStdAlertParamRecPtr = ^AlertStdAlertParamRec;
  306.     AlertStdAlertParamRec = RECORD
  307.         movable:                BOOLEAN;                                {  Make alert movable modal  }
  308.         helpButton:                BOOLEAN;                                {  Is there a help button?  }
  309.         filterProc:                ModalFilterUPP;                            {  Event filter  }
  310.         defaultText:            StringPtr;                                {  Text for button in OK position  }
  311.         cancelText:                StringPtr;                                {  Text for button in cancel position  }
  312.         otherText:                StringPtr;                                {  Text for button in left position  }
  313.         defaultButton:            SInt16;                                    {  Which button behaves as the default  }
  314.         cancelButton:            SInt16;                                    {  Which one behaves as cancel (can be 0)  }
  315.         position:                UInt16;                                    {  Position (kWindowDefaultPosition in this case  }
  316.                                                                         {  equals kWindowAlertPositionParentWindowScreen)  }
  317.     END;
  318.  
  319.     AlertStdAlertParamPtr                = ^AlertStdAlertParamRec;
  320. { —————————————————————————————————————————————————————————————————————————————————— }
  321. {  Control Manager constants, etc.                                                     }
  322. { —————————————————————————————————————————————————————————————————————————————————— }
  323.  
  324. CONST
  325.     _ControlDispatch            = $AA73;
  326.  
  327.                                                                 {  resource types for new controls  }
  328.     kControlTabListResType        = 'tab#';                        {  used for tab control only }
  329.     kControlListDescResType        = 'ldes';                        {  used for list box control only }
  330.  
  331.                                                                 {  new part codes for new controls  }
  332.     kControlEditTextPart        = 5;
  333.     kControlPicturePart            = 6;
  334.     kControlIconPart            = 7;
  335.     kControlClockPart            = 8;
  336.     kControlListBoxPart            = 24;
  337.     kControlListBoxDoubleClickPart = 25;
  338.  
  339.     kControlSupportsNewMessages    = ' ok ';                        {  CDEF should return as result of kControlMsgTestNewMsgSupport }
  340.  
  341. {  focusing part codes  }
  342.     kControlFocusNoPart            = 0;                            {  tells control to clear its focus }
  343.     kControlFocusNextPart        = -1;                            {  tells control to focus on the next part }
  344.     kControlFocusPrevPart        = -2;                            {  tells control to focus on the previous part }
  345.  
  346.  
  347. TYPE
  348.     ControlFocusPart                    = SInt16;
  349. {  Key Filter result codes                                                              }
  350. {                                                                                      }
  351. {  Certain controls can have a keyfilter attached to them. The filter proc should     }
  352. {  return one of the two constants below. If kKeyFilterBlockKey is returned, the     }
  353. {  key is blocked and never makes it to the control. If kKeyFilterPassKey is         }
  354. {  returned, the control receives the keystroke.                                     }
  355.  
  356. CONST
  357.     kControlKeyFilterBlockKey    = 0;
  358.     kControlKeyFilterPassKey    = 1;
  359.  
  360.  
  361. TYPE
  362.     ControlKeyFilterResult                = SInt16;
  363. { —————————————————————————————————————————————————————————————————————————————————————— }
  364. {
  365.      SPECIAL FONT USAGE NOTES: You can specify the font to use for many control types.
  366.     The constants below are meta-font numbers which you can use to set a particular
  367.     control's font usage. There are essentially two modes you can use: 1) default,
  368.     which is essentially the same as it always has been, i.e. it uses the system font, unless
  369.     directed to use the window font via a control variant. 2) you can specify to use
  370.     the big or small system font in a generic manner. The Big system font is the font
  371.     used in menus, etc. Chicago has filled that role for some time now. Small system
  372.     font is currently Geneva 10. The meta-font number implies the size and style.
  373.     
  374.     NOTE:        Not all font attributes are used by all controls. Most, in fact, ignore
  375.                 the fore and back color (Static Text is the only one that does, for
  376.                 backwards compatibility). Also size, face, and addFontSize are ignored
  377.                 when using the meta-font numbering.
  378. }
  379. { —————————————————————————————————————————————————————————————————————————————————————— }
  380.  
  381. CONST
  382.                                                                 {  Meta-font numbering - see not above  }
  383.     kControlFontBigSystemFont    = -1;                            {  force to big system font }
  384.     kControlFontSmallSystemFont    = -2;                            {  force to small system font }
  385.     kControlFontSmallBoldSystemFont = -3;                        {  force to small bold system font }
  386.  
  387. {  Add these masks together to set the flags field of a ControlFontStyleRec     }
  388. {  They specify which fields to apply to the text. It is important to make     }
  389. {  sure that you specify only the fields that you wish to set.                 }
  390.     kControlUseFontMask            = $0001;
  391.     kControlUseFaceMask            = $0002;
  392.     kControlUseSizeMask            = $0004;
  393.     kControlUseForeColorMask    = $0008;
  394.     kControlUseBackColorMask    = $0010;
  395.     kControlUseModeMask            = $0020;
  396.     kControlUseJustMask            = $0040;
  397.     kControlUseAllMask            = $00FF;
  398.     kControlAddFontSizeMask        = $0100;
  399.  
  400.  
  401. TYPE
  402.     ControlFontStyleRecPtr = ^ControlFontStyleRec;
  403.     ControlFontStyleRec = RECORD
  404.         flags:                    SInt16;
  405.         font:                    SInt16;
  406.         size:                    SInt16;
  407.         style:                    SInt16;
  408.         mode:                    SInt16;
  409.         just:                    SInt16;
  410.         foreColor:                RGBColor;
  411.         backColor:                RGBColor;
  412.     END;
  413.  
  414.     ControlFontStylePtr                    = ^ControlFontStyleRec;
  415. { —————————————————————————————————————————————————————————————————————————————————————— }
  416. {  Common data tags for Get/SetControlData                                                 }
  417. { —————————————————————————————————————————————————————————————————————————————————————— }
  418.  
  419. CONST
  420.     kControlFontStyleTag        = 'font';
  421.     kControlKeyFilterTag        = 'fltr';
  422.  
  423. { —————————————————————————————————————————————————————————————————————————————————————— }
  424. {  Errors are in the range -30580 .. -30599                                                 }
  425. { —————————————————————————————————————————————————————————————————————————————————————— }
  426.     errMessageNotSupported        = -30580;
  427.     errDataNotSupported            = -30581;
  428.     errControlDoesntSupportFocus = -30582;
  429.     errWindowDoesntSupportFocus    = -30583;
  430.     errUnknownControl            = -30584;
  431.     errCouldntSetFocus            = -30585;
  432.     errNoRootControl            = -30586;
  433.     errRootAlreadyExists        = -30587;
  434.     errInvalidPartCode            = -30588;
  435.     errControlsAlreadyExist        = -30589;
  436.     errControlIsNotEmbedder        = -30590;
  437.     errDataSizeMismatch            = -30591;
  438.     errControlHiddenOrDisabled    = -30592;
  439.     errWindowRegionCodeInvalid    = -30593;
  440.     errCantEmbedIntoSelf        = -30594;
  441.     errCantEmbedRoot            = -30595;
  442.     errItemNotControl            = -30596;
  443.  
  444.                                                                 {  Control feature bits - returned by GetControlFeatures  }
  445.     kControlSupportsGhosting    = $01;
  446.     kControlSupportsEmbedding    = $02;
  447.     kControlSupportsFocus        = $04;
  448.     kControlWantsIdle            = $08;
  449.     kControlWantsActivate        = $10;
  450.     kControlHandlesTracking        = $20;
  451.     kControlSupportsDataAccess    = $40;
  452.     kControlHasSpecialBackground = $80;
  453.     kControlGetsFocusOnClick    = $0100;
  454.     kControlSupportsCalcBestRect = $0200;
  455.     kControlSupportsLiveFeedback = $0400;
  456.  
  457.                                                                 {  Control Messages  }
  458.     kControlMsgDrawGhost        = 13;
  459.     kControlMsgCalcBestRect        = 14;                            {  Calculate best fitting rectangle for control }
  460.     kControlMsgHandleTracking    = 15;
  461.     kControlMsgFocus            = 16;                            {  param indicates action. }
  462.     kControlMsgKeyDown            = 17;
  463.     kControlMsgIdle                = 18;
  464.     kControlMsgGetFeatures        = 19;
  465.     kControlMsgSetData            = 20;
  466.     kControlMsgGetData            = 21;
  467.     kControlMsgActivate            = 22;
  468.     kControlMsgSetUpBackground    = 23;
  469.     kControlMsgCalcValue        = 24;
  470.     kControlMsgSubControlHit    = 25;
  471.     kControlMsgCalcValueFromPos    = 26;
  472.     kControlMsgTestNewMsgSupport = 27;                            {  See if this control supports new messaging }
  473.  
  474. { —————————————————————————————————————————————————————————————————————————————————————— }
  475. {      This structure is passed into a CDEF when called with the kControlMsgHandleTracking     }
  476. {     message                                                                              }
  477. { —————————————————————————————————————————————————————————————————————————————————————— }
  478.  
  479. TYPE
  480.     ControlTrackingRecPtr = ^ControlTrackingRec;
  481.     ControlTrackingRec = RECORD
  482.         startPt:                Point;
  483.         modifiers:                SInt16;
  484.         action:                    ControlActionUPP;
  485.     END;
  486.  
  487.     ControlTrackingPtr                    = ^ControlTrackingRec;
  488. { —————————————————————————————————————————————————————————————————————————————————————— }
  489. {  This structure is passed into a CDEF when called with the kControlMsgKeyDown message  }
  490. { —————————————————————————————————————————————————————————————————————————————————————— }
  491.     ControlKeyDownRecPtr = ^ControlKeyDownRec;
  492.     ControlKeyDownRec = RECORD
  493.         modifiers:                SInt16;
  494.         keyCode:                SInt16;
  495.         charCode:                SInt16;
  496.     END;
  497.  
  498.     ControlKeyDownPtr                    = ^ControlKeyDownRec;
  499. { —————————————————————————————————————————————————————————————————————————————————————— }
  500. {  This structure is passed into a CDEF when called with the kControlMsgGetData or         }
  501. {  kControlMsgSetData message                                                              }
  502. { —————————————————————————————————————————————————————————————————————————————————————— }
  503.     ControlDataAccessRecPtr = ^ControlDataAccessRec;
  504.     ControlDataAccessRec = RECORD
  505.         tag:                    ResType;
  506.         part:                    ResType;
  507.         size:                    Size;
  508.         dataPtr:                Ptr;
  509.     END;
  510.  
  511.     ControlDataAccessPtr                = ^ControlDataAccessRec;
  512. { —————————————————————————————————————————————————————————————————————————————————————— }
  513. {  This structure is passed into a CDEF when called with the kControlCalcBestRect msg      }
  514. { —————————————————————————————————————————————————————————————————————————————————————— }
  515.     ControlCalcSizeRecPtr = ^ControlCalcSizeRec;
  516.     ControlCalcSizeRec = RECORD
  517.         height:                    SInt16;
  518.         width:                    SInt16;
  519.         baseLine:                SInt16;
  520.     END;
  521.  
  522.     ControlCalcSizePtr                    = ^ControlCalcSizeRec;
  523. { —————————————————————————————————————————————————————————————————————————————————————— }
  524. {  This structure is passed into a CDEF when called with the kControlMsgSetUpBackground  }
  525. {  message is sent                                                                         }
  526. { —————————————————————————————————————————————————————————————————————————————————————— }
  527.     ControlBackgroundRecPtr = ^ControlBackgroundRec;
  528.     ControlBackgroundRec = RECORD
  529.         depth:                    SInt16;
  530.         colorDevice:            BOOLEAN;
  531.     END;
  532.  
  533.     ControlBackgroundPtr                = ^ControlBackgroundRec;
  534. { —————————————————————————————————————————————————————————————————————————————————————— }
  535. {     Key Filter                                                                             }
  536. {                                                                                          }
  537. {  Definition of a key filter for intercepting and possibly changing keystrokes             }
  538. {  which are destined for a control                                                         }
  539. { —————————————————————————————————————————————————————————————————————————————————————— }
  540.     ControlKeyFilterProcPtr = ProcPtr;  { FUNCTION ControlKeyFilter(theControl: ControlHandle; VAR keyCode: SInt16; VAR charCode: SInt16; VAR modifiers: SInt16): ControlKeyFilterResult; }
  541.  
  542.     ControlKeyFilterUPP = UniversalProcPtr;
  543.  
  544. CONST
  545.     uppControlKeyFilterProcInfo = $00003FE0;
  546.  
  547. FUNCTION NewControlKeyFilterProc(userRoutine: ControlKeyFilterProcPtr): ControlKeyFilterUPP;
  548.     {$IFC NOT GENERATINGCFM }
  549.     INLINE $2E9F;
  550.     {$ENDC}
  551.  
  552. FUNCTION CallControlKeyFilterProc(theControl: ControlHandle; VAR keyCode: SInt16; VAR charCode: SInt16; VAR modifiers: SInt16; userRoutine: ControlKeyFilterUPP): ControlKeyFilterResult;
  553.     {$IFC NOT GENERATINGCFM}
  554.     INLINE $205F, $4E90;
  555.     {$ENDC}
  556. { —————————————————————————————————————————————————————————————————————————————————————— }
  557. {     • BEVEL BUTTON INTERFACE (CDEF 2)                                                     }
  558. { —————————————————————————————————————————————————————————————————————————————————————— }
  559. {     Bevel buttons allow you to control the content type (pict/icon/etc.), the behavior     }
  560. {  (pushbutton/toggle/sticky), and the bevel size. You also have the option of             }
  561. {     attaching a menu to it. When a menu is present, you can specify which way the          }
  562. {     popup arrow is facing (down or right).                                                 }
  563. {                                                                                          }
  564. {     This is all made possible by overloading the Min, Max, and Value parameters for the     }
  565. {     control, as well as adjusting the variant. Here's the breakdown of what goes where:     }
  566. {                                                                                          }
  567. {     Parameter                    What Goes Here                                             }
  568. {     ———————————————————            ————————————————————————————————————————————————————     }
  569. {     Min                            Hi Byte = Behavior, Lo Byte = content type.                 }
  570. {     Max                            ResID for resource-based content types.                     }
  571. {     Value                        MenuID to attach, 0 = no menu, please.                     }
  572. {                                                                                          }
  573. {     The variant is broken down into two halfs. The low 2 bits control the bevel type.     }
  574. {     Bit 2 controls the popup arrow direction (if a menu is present) and bit 3 controls     }
  575. {     whether or not to use the control's owning window's font.                             }
  576. {                                                                                          }
  577. {     Constants for all you need to put this together are below. The values for behaviors     }
  578. {     are set up so that you can simply add them to the content type and pass them into     }
  579. {     the Min parameter of NewControl.                                                     }
  580. {                                                                                          }
  581. {     An example call:                                                                     }
  582. {                                                                                          }
  583. {     control = NewControl( window, &bounds, "\p", true, 0, kContentIconSuiteRes +          }
  584. {                             kBehaviorToggles, myIconSuiteID, bevelButtonSmallBevelProc,     }
  585. {                             0L );                                                         }
  586. {                                                                                          }
  587. {     Attaching a menu:                                                                     }
  588. {                                                                                          }
  589. {     control = NewControl( window, &bounds, "\p", true, kMyMenuID, kContentIconSuiteRes,     }
  590. {             myIconSuiteID, bevelButtonSmallBevelProc + kBevelButtonMenuOnRight, 0L );     }
  591. {                                                                                          }
  592. {     This will attach menu ID kMyMenuID to the button, with the popup arrow facing right. }
  593. {     This also puts the menu up to the right of the button. You can also specify that a     }
  594. {     menu can have multiple items checked at once by adding kBehaviorMultiValueMenus         }
  595. {     into the Min parameter. If you do use multivalue menus, the GetBevelButtonMenuValue     }
  596. {     helper function will return the last item chosen from the menu, whether or not it     }
  597. {     was checked.                                                                         }
  598. {                                                                                          }
  599. {     NOTE:     Bevel buttons with menus actually have *two* values. The value of the          }
  600. {             button (on/off), and the value of the menu. The menu value can be gotten     }
  601. {             with the GetBevelButtonMenuValue helper function.                             }
  602. {                                                                                          }
  603. {     Handle-based Content                                                                 }
  604. {     ————————————————————                                                                 }
  605. {     You can create your control and then set the content to an existing handle to an     }
  606. {     icon suite, etc. using the macros below. Please keep in mind that resource-based     }
  607. {     content is owned by the control, handle-based content is owned by you. The CDEF will }
  608. {     not try to dispose of handle-based content. If you are changing the content type of     }
  609. {     the button on the fly, you must make sure that if you are replacing a handle-         }
  610. {     based content with a resource-based content to properly dispose of the handle,         }
  611. {     else a memory leak will ensue.                                                         }
  612. {                                                                                          }
  613.  
  614. CONST
  615.                                                                 {  Bevel Button Proc IDs  }
  616.     kControlBevelButtonSmallBevelProc = 32;
  617.     kControlBevelButtonNormalBevelProc = 33;
  618.     kControlBevelButtonLargeBevelProc = 34;
  619.  
  620.                                                                 {  Bevel button graphic alignment values  }
  621.     kControlBevelButtonAlignSysDirection = -1;                    {  only left or right }
  622.     kControlBevelButtonAlignCenter = 0;
  623.     kControlBevelButtonAlignLeft = 1;
  624.     kControlBevelButtonAlignRight = 2;
  625.     kControlBevelButtonAlignTop    = 3;
  626.     kControlBevelButtonAlignBottom = 4;
  627.     kControlBevelButtonAlignTopLeft = 5;
  628.     kControlBevelButtonAlignBottomLeft = 6;
  629.     kControlBevelButtonAlignTopRight = 7;
  630.     kControlBevelButtonAlignBottomRight = 8;
  631.  
  632.  
  633. TYPE
  634.     ControlButtonGraphicAlignment        = SInt16;
  635.  
  636. CONST
  637.                                                                 {  Bevel button text alignment values  }
  638.     kControlBevelButtonAlignTextSysDirection = 0;
  639.     kControlBevelButtonAlignTextCenter = 1;
  640.     kControlBevelButtonAlignTextFlushRight = -1;
  641.     kControlBevelButtonAlignTextFlushLeft = -2;
  642.  
  643.  
  644. TYPE
  645.     ControlButtonTextAlignment            = SInt16;
  646.  
  647. CONST
  648.                                                                 {  Bevel button text placement values  }
  649.     kControlBevelButtonPlaceSysDirection = -1;                    {  if graphic on right, then on left }
  650.     kControlBevelButtonPlaceNormally = 0;
  651.     kControlBevelButtonPlaceToRightOfGraphic = 1;
  652.     kControlBevelButtonPlaceToLeftOfGraphic = 2;
  653.     kControlBevelButtonPlaceBelowGraphic = 3;
  654.     kControlBevelButtonPlaceAboveGraphic = 4;
  655.  
  656.  
  657. TYPE
  658.     ControlButtonTextPlacement            = SInt16;
  659. {  Add these variant codes to kBevelButtonSmallBevelProc to change the type of button  }
  660.  
  661. CONST
  662.     kControlBevelButtonSmallBevelVariant = 0;
  663.     kControlBevelButtonNormalBevelVariant = $01;
  664.     kControlBevelButtonLargeBevelVariant = $02;
  665.     kControlBevelButtonMenuOnRight = $04;
  666.  
  667. {
  668.  Behaviors of bevel buttons. These are set up so you can add
  669.  them together with the content types.
  670. }
  671.     kControlBehaviorPushbutton    = 0;
  672.     kControlBehaviorToggles        = $0100;
  673.     kControlBehaviorSticky        = $0200;
  674.     kControlBehaviorMultiValueMenu = $4000;                        {  only makes sense when a menu is attached. }
  675.     kControlBehaviorOffsetContents = $8000;
  676.  
  677. {  Content types supported by bevel buttons *and* image wells }
  678.     kControlContentTextOnly        = 0;
  679.     kControlContentIconSuiteRes    = 1;
  680.     kControlContentCIconRes        = 2;
  681.     kControlContentPictRes        = 3;
  682.     kControlContentIconSuiteHandle = 129;
  683.     kControlContentCIconHandle    = 130;
  684.     kControlContentPictHandle    = 131;
  685.     kControlContentIconRef        = 132;
  686.  
  687.  
  688. TYPE
  689.     ControlContentType                    = SInt16;
  690. {  Data tags supported by the bevel button controls  }
  691.  
  692. CONST
  693.     kControlBevelButtonContentTag = 'cont';                        {  ButtonContentInfo }
  694.     kControlBevelButtonTransformTag = 'tran';                    {  IconTransformType }
  695.     kControlBevelButtonTextAlignTag = 'tali';                    {  ButtonTextAlignment }
  696.     kControlBevelButtonTextOffsetTag = 'toff';                    {  SInt16 }
  697.     kControlBevelButtonGraphicAlignTag = 'gali';                {  ButtonGraphicAlignment }
  698.     kControlBevelButtonGraphicOffsetTag = 'goff';                {  Point }
  699.     kControlBevelButtonTextPlaceTag = 'tplc';                    {  ButtonTextPlacement }
  700.     kControlBevelButtonMenuValueTag = 'mval';                    {  SInt16 }
  701.     kControlBevelButtonMenuHandleTag = 'mhnd';                    {  MenuHandle }
  702.  
  703. {  Structure to pass into bevel buttons and image wells to set/get content type  }
  704.  
  705. TYPE
  706.     ControlButtonContentInfoPtr = ^ControlButtonContentInfo;
  707.     ControlButtonContentInfo = RECORD
  708.         contentType:            ControlContentType;
  709.         CASE INTEGER OF
  710.         0: (
  711.             resID:                SInt16;
  712.             );
  713.         1: (
  714.             cIconHandle:        CIconHandle;
  715.             );
  716.         2: (
  717.             iconSuite:            Handle;
  718.             );
  719.         3: (
  720.             iconRef:            Handle;
  721.             );
  722.         4: (
  723.             picture:            PicHandle;
  724.             );
  725.     END;
  726.  
  727. { —————————————————————————————————————————————————————————————————————————————————————— }
  728. {     • SLIDER (CDEF 3)                                                                     }
  729. { —————————————————————————————————————————————————————————————————————————————————————— }
  730. {     There are several variants that control the behavior of the slider control. Any         }
  731. {     combination of the following three constants can be added to the basic CDEF ID         }
  732. {     (kSliderProc).                                                                         }
  733. {                                                                                          }
  734. {     Variants:                                                                             }
  735. {                                                                                          }
  736. {         kSliderLiveFeedback         Slider does not use "ghosted" indicator when tracking.     }
  737. {                                 ActionProc is called (set via SetControlAction) as the     }
  738. {                                 indicator is dragged. The value is updated so that the     }
  739. {                                 actionproc can adjust some other property based on the     }
  740. {                                 value each time the action proc is called. If no action     }
  741. {                                 proc is installed, it reverts to the ghost indicator.     }
  742. {                                                                                          }
  743. {         kSliderHasTickMarks         Slider is drawn with 'tick marks'. The control             }
  744. {                                 rectangle must be large enough to accomidate the tick     }
  745. {                                 marks.                                                     }
  746. { /*        kSliderReverseDirection    Slider thumb points in opposite direction than normal.     }
  747. {                                 If the slider is vertical, the thumb will point to the     }
  748. {                                 left, if the slider is horizontal, the thumb will point     }
  749. {                                 upwards.                                                 }
  750. {                                                                                          }
  751. {         kSliderNonDirectional    This option overrides the kSliderReverseDirection and     }
  752. {                                 kSliderHasTickMarks variants. It creates an indicator     }
  753. {                                 which is rectangular and doesn't point in any direction     }
  754. {                                 like the normal indicator does.                             }
  755.  
  756. CONST
  757.                                                                 {  Slider proc IDs  }
  758.     kControlSliderProc            = 48;
  759.     kControlSliderLiveFeedback    = $01;
  760.     kControlSliderHasTickMarks    = $02;
  761.     kControlSliderReverseDirection = $04;
  762.     kControlSliderNonDirectional = $08;
  763.  
  764. { —————————————————————————————————————————————————————————————————————————————————————— }
  765. {     • DISCLOSURE TRIANGLE (CDEF 4)                                                         }
  766. { —————————————————————————————————————————————————————————————————————————————————————— }
  767. {     This control can be used as either left or right facing. It can also handle its own     }
  768. {     tracking if you wish. This means that when the 'autotoggle' variant is used, if the     }
  769. {     user clicks the control, it's state will change automatically from open to closed     }
  770. {     and vice-versa depending on its initial state. After a successful call to Track-     }
  771. {      Control, you can just check the current value to see what state it was switched to.     }
  772.                                                                 {  Triangle proc IDs  }
  773.     kControlTriangleProc        = 64;
  774.     kControlTriangleLeftFacingProc = 65;
  775.     kControlTriangleAutoToggleProc = 66;
  776.     kControlTriangleLeftFacingAutoToggleProc = 67;
  777.  
  778.                                                                 {  Tagged data supported by disclosure triangles  }
  779.     kControlTriangleLastValueTag = 'last';                        {  SInt16 }
  780.  
  781. { —————————————————————————————————————————————————————————————————————————————————————— }
  782. {     • PROGRESS INDICATOR (CDEF 5)                                                         }
  783. { —————————————————————————————————————————————————————————————————————————————————————— }
  784. {     This CDEF implements both determinate and indeterminate progress bars. To switch,      }
  785. {     just use SetControlData to set the indeterminate flag to make it indeterminate call     }
  786. {     IdleControls to step thru the animation. IdleControls should be called at least         }
  787. {     once during your event loop.                                                         }
  788. {                                                                                          }
  789.                                                                 {  Progress Bar proc IDs  }
  790.     kControlProgressBarProc        = 80;
  791.  
  792.                                                                 {  Tagged data supported by progress bars  }
  793.     kControlProgressBarIndeterminateTag = 'inde';                {  Boolean }
  794.  
  795. { —————————————————————————————————————————————————————————————————————————————————————— }
  796. {     • LITTLE ARROWS (CDEF 6)                                                             }
  797. { —————————————————————————————————————————————————————————————————————————————————————— }
  798. {      This control implements the little up and down arrows you'd see in the Memory         }
  799. {     control panel for adjusting the cache size.                                          }
  800.                                                                 {  Little Arrows proc IDs  }
  801.     kControlLittleArrowsProc    = 96;
  802.  
  803. { —————————————————————————————————————————————————————————————————————————————————————— }
  804. {     • CHASING ARROWS (CDEF 7)                                                             }
  805. { —————————————————————————————————————————————————————————————————————————————————————— }
  806. {     To animate this control, make sure to call IdleControls repeatedly.                     }
  807. {                                                                                          }
  808.                                                                 {  Chasing Arrows proc IDs  }
  809.     kControlChasingArrowsProc    = 112;
  810.  
  811. { —————————————————————————————————————————————————————————————————————————————————————— }
  812. {     • TABS (CDEF 8)                                                                         }
  813. { —————————————————————————————————————————————————————————————————————————————————————— }
  814. {     Tabs use an auxiliary resource (tab#) to hold tab information such as the tab name     }
  815. {     and an icon suite ID for each tab.                                                     }
  816. {                                                                                          }
  817. {     The ID of the tab# resource that you wish to associate with a tab control should      }
  818. {     be passed in as the Value parameter of the control. If you are using GetNewControl,  }
  819. {     then the Value slot in the CNTL resource should have the ID of the 'tab#' resource     }
  820. {     on creation.                                                                         }
  821. {                                                                                          }
  822.                                                                 {  Tabs proc IDs  }
  823.     kControlTabLargeProc        = 128;                            {  Large tab size     }
  824.     kControlTabSmallProc        = 129;                            {  Small tab size     }
  825.  
  826.                                                                 {  Tagged data supported by progress bars  }
  827.     kControlTabContentRectTag    = 'rect';                        {  Rect }
  828.     kControlTabEnabledFlagTag    = 'enab';                        {  Boolean }
  829.     kControlTabFontStyleTag        = 'font';                        {  ControlFontStyleRec }
  830.  
  831. { —————————————————————————————————————————————————————————————————————————————————————— }
  832. {     • VISUAL SEPARATOR (CDEF 9)                                                             }
  833. { —————————————————————————————————————————————————————————————————————————————————————— }
  834. {     Separator lines determine their orientation (horizontal or vertical) automatically     }
  835. {     based on the relative height and width of their contrlRect.                             }
  836.                                                                 {  Visual separator proc IDs  }
  837.     kControlSeparatorLineProc    = 144;
  838.  
  839. { —————————————————————————————————————————————————————————————————————————————————————— }
  840. {     • GROUP BOX (CDEF 10)                                                                 }
  841. { —————————————————————————————————————————————————————————————————————————————————————— }
  842. {     The group box CDEF can be use in several ways. It can have no title, a text title,      }
  843. {     a check box as the title, or a popup button as a title. There are two versions of      }
  844. {     group boxes, primary and secondary, which look slightly different.                     }
  845.                                                                 {  Group Box proc IDs  }
  846.     kControlGroupBoxTextTitleProc = 160;
  847.     kControlGroupBoxCheckBoxProc = 161;
  848.     kControlGroupBoxPopupButtonProc = 162;
  849.     kControlGroupBoxSecondaryTextTitleProc = 164;
  850.     kControlGroupBoxSecondaryCheckBoxProc = 165;
  851.     kControlGroupBoxSecondaryPopupButtonProc = 166;
  852.  
  853.                                                                 {  Tagged data supported by group box  }
  854.     kControlGroupBoxMenuHandleTag = 'mhan';                        {  MenuHandle (popup title only) }
  855.     kControlGroupBoxFontStyleTag = 'font';                        {  ControlFontStyleRec }
  856.  
  857. { —————————————————————————————————————————————————————————————————————————————————————— }
  858. {     • IMAGE WELL (CDEF 11)                                                                 }
  859. { —————————————————————————————————————————————————————————————————————————————————————— }
  860. {     Image Wells allow you to control the content type (pict/icon/etc.) shown in the      }
  861. {     well.                                                                                 }
  862. {                                                                                          }
  863. {     This is made possible by overloading the Min and Value parameters for the control.     }
  864. {                                                                                          }
  865. {     Parameter                    What Goes Here                                             }
  866. {     ———————————————————            ——————————————————————————————————————————————————         }
  867. {     Min                            content type (see constants for bevel buttons)             }
  868. {     Value                        Resource ID of content type, if resource-based.             }
  869. {                                                                                          }
  870. {                                                                                          }
  871. {     Checked State                                                                         }
  872. {     —————————————                                                                         }
  873. {     The checked state is enabled by setting the value of the control to 1, just like a      }
  874. {     check box.                                                                             }
  875. {                                                                                          }
  876. {     Handle-based Content                                                                 }
  877. {     ————————————————————                                                                 }
  878. {     You can create your control and then set the content to an existing handle to an     }
  879. {     icon suite, etc. using the macros below. Please keep in mind that resource-based     }
  880. {     content is owned by the control, handle-based content is owned by you. The CDEF will }
  881. {     not try to dispose of handle-based content. If you are changing the content type of     }
  882. {     the button on the fly, you must make sure that if you are replacing a handle-         }
  883. {     based content with a resource-based content to properly dispose of the handle,         }
  884. {     else a memory leak will ensue.                                                         }
  885. {                                                                                          }
  886. {                                                                                          }
  887. {     AutoTracking                                                                         }
  888. {     ————————————                                                                         }
  889. {     Image Wells are capable of autotracking. The current autotracking feature sets the      }
  890. {     value itself, so that the control remains hilited. It behaves as a sort of palette      }
  891. {     type object where clicking selects it, it cannot be delected by clicking it again,      }
  892. {     clicking on another object should cause the focus to change (as in Get Info windows) }
  893. {     and the application should then set the value to 0 to take away the checked border.     }
  894. {                                                                                          }
  895.                                                                 {  Image Well proc IDs  }
  896.     kControlImageWellProc        = 176;
  897.     kControlImageWellAutoTrackProc = 177;
  898.  
  899.                                                                 {  Tagged data supported by image wells  }
  900.     kControlImageWellContentTag    = 'cont';                        {  ButtonContentInfo }
  901.     kControlImageWellTransformTag = 'tran';                        {  IconTransformType }
  902.  
  903. { —————————————————————————————————————————————————————————————————————————————————————— }
  904. {     • POPUP ARROW (CDEF 12)                                                                 }
  905. { —————————————————————————————————————————————————————————————————————————————————————— }
  906. {     The popup arrow CDEF is used to draw the small arrow normally associated with a      }
  907. {     popup control. The arrow can point in four directions, and a small or large version  }
  908. {     can be used. This control is provided to allow clients to draw the arrow in a          }
  909. {     normalized fashion which will take advantage of themes automatically.                 }
  910. {                                                                                          }
  911.                                                                 {  Popup Arrow proc IDs  }
  912.     kControlPopupArrowEastProc    = 192;
  913.     kControlPopupArrowWestProc    = 193;
  914.     kControlPopupArrowNorthProc    = 194;
  915.     kControlPopupArrowSouthProc    = 195;
  916.     kControlPopupArrowSmallEastProc = 196;
  917.     kControlPopupArrowSmallWestProc = 197;
  918.     kControlPopupArrowSmallNorthProc = 198;
  919.     kControlPopupArrowSmallSouthProc = 199;
  920.  
  921. { —————————————————————————————————————————————————————————————————————————————————————— }
  922. {     • PLACARD (CDEF 14)                                                                     }
  923. { —————————————————————————————————————————————————————————————————————————————————————— }
  924.                                                                 {  Placard proc IDs  }
  925.     kControlPlacardProc            = 224;
  926.  
  927. { —————————————————————————————————————————————————————————————————————————————————————— }
  928. {     • CLOCK (CDEF 15)                                                                     }
  929. { —————————————————————————————————————————————————————————————————————————————————————— }
  930. {      NOTE:    You can specify more options in the Value paramter when creating the clock.     }
  931. {             See below.                                                                     }
  932.                                                                 {  Clock proc IDs  }
  933.     kControlClockTimeProc        = 240;
  934.     kControlClockTimeSecondsProc = 241;
  935.     kControlClockDateProc        = 242;
  936.     kControlClockMonthYearProc    = 243;
  937.  
  938. { —————————————————————————————————————————————————————————————————————————————————————— }
  939. {      These flags can be passed into 'value' field on creation of the control.             }
  940. {      Value is set to 0 after control is created.                                             }
  941. {                                                                                          }
  942. {     The kClockIsLive value tells the clock to automatically update on idle (clock will     }
  943. {     have the current time). This flag is only valid when the kClockIsDisplayOnly flag     }
  944. {     is set.                                                                                 }
  945. { —————————————————————————————————————————————————————————————————————————————————————— }
  946.     kControlClockNoFlags        = 0;
  947.     kControlClockIsDisplayOnly    = 1;
  948.     kControlClockIsLive            = 2;
  949.  
  950.                                                                 {  Tagged data supported by clocks  }
  951.     kControlClockLongDateTag    = 'date';                        {  LongDateRec }
  952.     kControlClockFontStyleTag    = 'font';                        {  ControlFontStyleRec }
  953.  
  954. { —————————————————————————————————————————————————————————————————————————————————————— }
  955. {     • USER PANE (CDEF 16)                                                                 }
  956. { —————————————————————————————————————————————————————————————————————————————————————— }
  957.                                                                 {  User Pane proc IDs  }
  958.     kControlUserPaneProc        = 256;
  959.  
  960. {  Tagged data supported by user panes  }
  961. {  Currently, they are all proc ptrs for doing things like drawing and hit testing, etc.  }
  962.     kControlUserItemDrawProcTag    = 'uidp';                        {  UserItemUPP }
  963.     kControlUserPaneDrawProcTag    = 'draw';                        {  ControlUserPaneDrawingUPP }
  964.     kControlUserPaneHitTestProcTag = 'hitt';                    {  ControlUserPaneHitTestUPP }
  965.     kControlUserPaneTrackingProcTag = 'trak';                    {  ControlUserPaneTrackingUPP }
  966.     kControlUserPaneIdleProcTag    = 'idle';                        {  ControlUserPaneIdleUPP }
  967.     kControlUserPaneKeyDownProcTag = 'keyd';                    {  ControlUserPaneKeyDownUPP }
  968.     kControlUserPaneActivateProcTag = 'acti';                    {  ControlUserPaneActivateUPP }
  969.     kControlUserPaneFocusProcTag = 'foci';                        {  ControlUserPaneFocusUPP }
  970.     kControlUserPaneBackgroundProcTag = 'back';                    {  ControlUserPaneBackgroundUPP }
  971.  
  972.  
  973. TYPE
  974.     ControlUserPaneDrawProcPtr = ProcPtr;  { PROCEDURE ControlUserPaneDraw(control: ControlHandle; part: SInt16); }
  975.  
  976.     ControlUserPaneHitTestProcPtr = ProcPtr;  { FUNCTION ControlUserPaneHitTest(control: ControlHandle; where: Point): ControlPartCode; }
  977.  
  978.     ControlUserPaneTrackingProcPtr = ProcPtr;  { FUNCTION ControlUserPaneTracking(control: ControlHandle; startPt: Point; actionProc: ControlActionUPP): ControlPartCode; }
  979.  
  980.     ControlUserPaneIdleProcPtr = ProcPtr;  { PROCEDURE ControlUserPaneIdle(control: ControlHandle); }
  981.  
  982.     ControlUserPaneKeyDownProcPtr = ProcPtr;  { FUNCTION ControlUserPaneKeyDown(control: ControlHandle; keyCode: SInt16; charCode: SInt16; modifiers: SInt16): ControlPartCode; }
  983.  
  984.     ControlUserPaneActivateProcPtr = ProcPtr;  { PROCEDURE ControlUserPaneActivate(control: ControlHandle; activating: BOOLEAN); }
  985.  
  986.     ControlUserPaneFocusProcPtr = ProcPtr;  { FUNCTION ControlUserPaneFocus(control: ControlHandle; action: ControlFocusPart): ControlPartCode; }
  987.  
  988.     ControlUserPaneBackgroundProcPtr = ProcPtr;  { PROCEDURE ControlUserPaneBackground(control: ControlHandle; info: ControlBackgroundPtr); }
  989.  
  990.     ControlUserPaneDrawUPP = UniversalProcPtr;
  991.     ControlUserPaneHitTestUPP = UniversalProcPtr;
  992.     ControlUserPaneTrackingUPP = UniversalProcPtr;
  993.     ControlUserPaneIdleUPP = UniversalProcPtr;
  994.     ControlUserPaneKeyDownUPP = UniversalProcPtr;
  995.     ControlUserPaneActivateUPP = UniversalProcPtr;
  996.     ControlUserPaneFocusUPP = UniversalProcPtr;
  997.     ControlUserPaneBackgroundUPP = UniversalProcPtr;
  998.  
  999. CONST
  1000.     uppControlUserPaneDrawProcInfo = $000002C0;
  1001.     uppControlUserPaneHitTestProcInfo = $000003E0;
  1002.     uppControlUserPaneTrackingProcInfo = $00000FE0;
  1003.     uppControlUserPaneIdleProcInfo = $000000C0;
  1004.     uppControlUserPaneKeyDownProcInfo = $00002AE0;
  1005.     uppControlUserPaneActivateProcInfo = $000001C0;
  1006.     uppControlUserPaneFocusProcInfo = $000002E0;
  1007.     uppControlUserPaneBackgroundProcInfo = $000003C0;
  1008.  
  1009. FUNCTION NewControlUserPaneDrawProc(userRoutine: ControlUserPaneDrawProcPtr): ControlUserPaneDrawUPP;
  1010.     {$IFC NOT GENERATINGCFM }
  1011.     INLINE $2E9F;
  1012.     {$ENDC}
  1013.  
  1014. FUNCTION NewControlUserPaneHitTestProc(userRoutine: ControlUserPaneHitTestProcPtr): ControlUserPaneHitTestUPP;
  1015.     {$IFC NOT GENERATINGCFM }
  1016.     INLINE $2E9F;
  1017.     {$ENDC}
  1018.  
  1019. FUNCTION NewControlUserPaneTrackingProc(userRoutine: ControlUserPaneTrackingProcPtr): ControlUserPaneTrackingUPP;
  1020.     {$IFC NOT GENERATINGCFM }
  1021.     INLINE $2E9F;
  1022.     {$ENDC}
  1023.  
  1024. FUNCTION NewControlUserPaneIdleProc(userRoutine: ControlUserPaneIdleProcPtr): ControlUserPaneIdleUPP;
  1025.     {$IFC NOT GENERATINGCFM }
  1026.     INLINE $2E9F;
  1027.     {$ENDC}
  1028.  
  1029. FUNCTION NewControlUserPaneKeyDownProc(userRoutine: ControlUserPaneKeyDownProcPtr): ControlUserPaneKeyDownUPP;
  1030.     {$IFC NOT GENERATINGCFM }
  1031.     INLINE $2E9F;
  1032.     {$ENDC}
  1033.  
  1034. FUNCTION NewControlUserPaneActivateProc(userRoutine: ControlUserPaneActivateProcPtr): ControlUserPaneActivateUPP;
  1035.     {$IFC NOT GENERATINGCFM }
  1036.     INLINE $2E9F;
  1037.     {$ENDC}
  1038.  
  1039. FUNCTION NewControlUserPaneFocusProc(userRoutine: ControlUserPaneFocusProcPtr): ControlUserPaneFocusUPP;
  1040.     {$IFC NOT GENERATINGCFM }
  1041.     INLINE $2E9F;
  1042.     {$ENDC}
  1043.  
  1044. FUNCTION NewControlUserPaneBackgroundProc(userRoutine: ControlUserPaneBackgroundProcPtr): ControlUserPaneBackgroundUPP;
  1045.     {$IFC NOT GENERATINGCFM }
  1046.     INLINE $2E9F;
  1047.     {$ENDC}
  1048.  
  1049. PROCEDURE CallControlUserPaneDrawProc(control: ControlHandle; part: SInt16; userRoutine: ControlUserPaneDrawUPP);
  1050.     {$IFC NOT GENERATINGCFM}
  1051.     INLINE $205F, $4E90;
  1052.     {$ENDC}
  1053.  
  1054. FUNCTION CallControlUserPaneHitTestProc(control: ControlHandle; where: Point; userRoutine: ControlUserPaneHitTestUPP): ControlPartCode;
  1055.     {$IFC NOT GENERATINGCFM}
  1056.     INLINE $205F, $4E90;
  1057.     {$ENDC}
  1058.  
  1059. FUNCTION CallControlUserPaneTrackingProc(control: ControlHandle; startPt: Point; actionProc: ControlActionUPP; userRoutine: ControlUserPaneTrackingUPP): ControlPartCode;
  1060.     {$IFC NOT GENERATINGCFM}
  1061.     INLINE $205F, $4E90;
  1062.     {$ENDC}
  1063.  
  1064. PROCEDURE CallControlUserPaneIdleProc(control: ControlHandle; userRoutine: ControlUserPaneIdleUPP);
  1065.     {$IFC NOT GENERATINGCFM}
  1066.     INLINE $205F, $4E90;
  1067.     {$ENDC}
  1068.  
  1069. FUNCTION CallControlUserPaneKeyDownProc(control: ControlHandle; keyCode: SInt16; charCode: SInt16; modifiers: SInt16; userRoutine: ControlUserPaneKeyDownUPP): ControlPartCode;
  1070.     {$IFC NOT GENERATINGCFM}
  1071.     INLINE $205F, $4E90;
  1072.     {$ENDC}
  1073.  
  1074. PROCEDURE CallControlUserPaneActivateProc(control: ControlHandle; activating: BOOLEAN; userRoutine: ControlUserPaneActivateUPP);
  1075.     {$IFC NOT GENERATINGCFM}
  1076.     INLINE $205F, $4E90;
  1077.     {$ENDC}
  1078.  
  1079. FUNCTION CallControlUserPaneFocusProc(control: ControlHandle; action: ControlFocusPart; userRoutine: ControlUserPaneFocusUPP): ControlPartCode;
  1080.     {$IFC NOT GENERATINGCFM}
  1081.     INLINE $205F, $4E90;
  1082.     {$ENDC}
  1083.  
  1084. PROCEDURE CallControlUserPaneBackgroundProc(control: ControlHandle; info: ControlBackgroundPtr; userRoutine: ControlUserPaneBackgroundUPP);
  1085.     {$IFC NOT GENERATINGCFM}
  1086.     INLINE $205F, $4E90;
  1087.     {$ENDC}
  1088. {
  1089. ——————————————————————————————————————————————————————————————————————————————————————————
  1090.     • EDIT TEXT (CDEF 17)
  1091. ——————————————————————————————————————————————————————————————————————————————————————————
  1092. }
  1093.  
  1094. CONST
  1095.                                                                 {  Edit Text proc IDs  }
  1096.     kControlEditTextProc        = 272;
  1097.     kControlEditTextDialogProc    = 273;
  1098.     kControlEditTextPasswordProc = 274;
  1099.  
  1100.                                                                 {  Tagged data supported by edit text  }
  1101.     kControlEditTextStyleTag    = 'font';                        {  ControlFontStyleRec }
  1102.     kControlEditTextTextTag        = 'text';                        {  Buffer of chars - you supply the buffer }
  1103.     kControlEditTextTEHandleTag    = 'than';                        {  The TEHandle of the text edit record }
  1104.     kControlEditTextKeyFilterTag = 'fltr';
  1105.     kControlEditTextSelectionTag = 'sele';                        {  EditTextSelectionRec }
  1106.     kControlEditTextPasswordTag    = 'pass';                        {  The clear text password text }
  1107.  
  1108.  
  1109. TYPE
  1110.     ControlEditTextSelectionRecPtr = ^ControlEditTextSelectionRec;
  1111.     ControlEditTextSelectionRec = RECORD
  1112.                                                                         {  Structure for getting the edit text selection  }
  1113.         selStart:                SInt16;
  1114.         selEnd:                    SInt16;
  1115.     END;
  1116.  
  1117.     ControlEditTextSelectionPtr            = ^ControlEditTextSelectionRec;
  1118. { —————————————————————————————————————————————————————————————————————————————————————— }
  1119. {     • STATIC TEXT (CDEF 18)                                                                 }
  1120. { —————————————————————————————————————————————————————————————————————————————————————— }
  1121. {  Static Text proc IDs  }
  1122.  
  1123. CONST
  1124.     kControlStaticTextProc        = 288;
  1125.  
  1126. {  Tagged data supported by static text  }
  1127.     kControlStaticTextStyleTag    = 'font';                        {  ControlFontStyleRec }
  1128.     kControlStaticTextTextTag    = 'text';                        {  Copy of text }
  1129.     kControlStaticTextTextHeightTag = 'thei';                    {  SInt16 }
  1130.  
  1131. { —————————————————————————————————————————————————————————————————————————————————————— }
  1132. {     • PICTURE CONTROL (CDEF 19)                                                             }
  1133. { —————————————————————————————————————————————————————————————————————————————————————— }
  1134. {     Value parameter should contain the ID of the picture you wish to display when         }
  1135. {     creating controls of this type. If you don't want the control tracked at all, use      }
  1136. {     the 'no track' variant.                                                                 }
  1137.                                                                 {  Picture control proc IDs  }
  1138.     kControlPictureProc            = 304;
  1139.     kControlPictureNoTrackProc    = 305;                            {  immediately returns kControlPicturePart }
  1140.  
  1141. { —————————————————————————————————————————————————————————————————————————————————————— }
  1142. {     • ICON CONTROL (CDEF 20)                                                             }
  1143. { —————————————————————————————————————————————————————————————————————————————————————— }
  1144. {     Value parameter should contain the ID of the ICON or cicn you wish to display when     }
  1145. {     creating controls of this type. If you don't want the control tracked at all, use      }
  1146. {     the 'no track' variant.                                                                 }
  1147. {  Icon control proc IDs  }
  1148.     kControlIconProc            = 320;
  1149.     kControlIconNoTrackProc        = 321;                            {  immediately returns kControlIconPart }
  1150.     kControlIconSuiteProc        = 322;
  1151.     kControlIconSuiteNoTrackProc = 323;                            {  immediately returns kControlIconPart }
  1152.  
  1153. {  Tagged data supported by icon controls  }
  1154.     kControlIconTransformTag    = 'trfm';                        {  IconTransformType }
  1155.     kControlIconAlignmentTag    = 'algn';                        {  IconAlignmentType }
  1156.  
  1157. { —————————————————————————————————————————————————————————————————————————————————————— }
  1158. {     • WINDOW HEADER (CDEF 21)                                                             }
  1159. { —————————————————————————————————————————————————————————————————————————————————————— }
  1160.                                                                 {  Window Header proc IDs  }
  1161.     kControlWindowHeaderProc    = 336;                            {  normal header }
  1162.     kControlWindowListViewHeaderProc = 337;                        {  variant for list views - no bottom line }
  1163.  
  1164. { —————————————————————————————————————————————————————————————————————————————————————— }
  1165. {     • LIST BOX (CDEF 22)                                                                 }
  1166. { —————————————————————————————————————————————————————————————————————————————————————— }
  1167. {     Lists use an auxiliary resource to define their format. The resource type used is      }
  1168. {     'ldes' and a definition for it can be found in Appearance.r. The resource ID for      }
  1169. {     the ldes is passed in the 'value' parameter when creating the control.                 }
  1170.                                                                 {  List Box proc IDs  }
  1171.     kControlListBoxProc            = 352;
  1172.     kControlListBoxAutoSizeProc    = 353;
  1173.  
  1174.                                                                 {  Tagged data supported by list box  }
  1175.     kControlListBoxListHandleTag = 'lhan';                        {  ListHandle }
  1176.     kControlListBoxKeyFilterTag    = 'fltr';                        {  ControlKeyFilterUPP }
  1177.     kControlListBoxFontStyleTag    = 'font';                        {  ControlFontStyleRec }
  1178.  
  1179. { —————————————————————————————————————————————————————————————————————————————————————— }
  1180. {     • PUSH BUTTON (CDEF 23)                                                                 }
  1181. { —————————————————————————————————————————————————————————————————————————————————————— }
  1182. {     The new standard checkbox and radio button controls support a "mixed" value that     }
  1183. {     indicates that the current setting contains a mixed set of on and off values. The      }
  1184. {     control value used to display this indication is defined in Controls.h:                 }
  1185. {                                                                                          }
  1186. {         kControlCheckBoxMixedValue = 2                                                     }
  1187. {                                                                                          }
  1188. {     Two new variants of the standard pushbutton have been added to the standard control     }
  1189. {     suite that draw a color icon next to the control title. One variant draws the icon     }
  1190. {     on the left side, the other draws it on the right side (when the system justifica-     }
  1191. {     tion is right to left, these are reversed).                                             }
  1192. {                                                                                          }
  1193. {     When either of the icon pushbuttons are created, the contrlMax field of the control  }
  1194. {     record is used to determine the ID of the 'cicn' resource drawn in the pushbutton.     }
  1195. {                                                                                          }
  1196. {     In addition, a push button can now be told to draw with a default outline using the     }
  1197. {     SetControlData routine with the kPushButtonDefaultTag below.                         }
  1198. {                                                                                          }
  1199.                                                                 {  Theme Push Button/Check Box/Radio Button proc IDs  }
  1200.     kControlPushButtonProc        = 368;
  1201.     kControlCheckBoxProc        = 369;
  1202.     kControlRadioButtonProc        = 370;
  1203.     kControlPushButLeftIconProc    = 374;                            {  Standard pushbutton with left-side icon }
  1204.     kControlPushButRightIconProc = 375;                            {  Standard pushbutton with right-side icon }
  1205.  
  1206.                                                                 {  Tagged data supported by standard buttons  }
  1207.     kControlPushButtonDefaultTag = 'dflt';                        {  default ring flag }
  1208.  
  1209. { —————————————————————————————————————————————————————————————————————————————————————— }
  1210. {     • SCROLL BAR (CDEF 24)                                                                 }
  1211. { —————————————————————————————————————————————————————————————————————————————————————— }
  1212. {     This is the new Appearance scroll bar.                                                 }
  1213. {                                                                                          }
  1214.                                                                 {  Theme Scroll Bar proc IDs  }
  1215.     kControlScrollBarProc        = 384;                            {  normal scroll bar }
  1216.     kControlScrollBarLiveProc    = 386;                            {  live scrolling variant }
  1217.  
  1218. { —————————————————————————————————————————————————————————————————————————————————————— }
  1219. {     • POPUP BUTTON (CDEF 25)                                                             }
  1220. { —————————————————————————————————————————————————————————————————————————————————————— }
  1221. {     This is the new Appearance Popup Button. It takes the same variants and does the      }
  1222. {     same overloading as the previous popup menu control. There are some differences:     }
  1223. {                                                                                          }
  1224. {     Passing in a menu ID of -12345 causes the popup not to try and get the menu from a     }
  1225. {     resource. Instead, you can build the menu and later stuff the menuhandle field in      }
  1226. {     the popup data information.                                                             }
  1227. {                                                                                          }
  1228. {     You can pass -1 in the Max parameter to have the control calculate the width of the     }
  1229. {     title on its own instead of guessing and then tweaking to get it right. It adds the     }
  1230. {     appropriate amount of space between the title and the popup.                         }
  1231. {                                                                                          }
  1232.                                                                 {  Theme Popup Button proc IDs  }
  1233.     kControlPopupButtonProc        = 400;
  1234.     kControlPopupFixedWidthVariant = $01;
  1235.     kControlPopupVariableWidthVariant = $02;
  1236.     kControlPopupUseAddResMenuVariant = $04;
  1237.     kControlPopupUseWFontVariant = $08;
  1238.  
  1239. { —————————————————————————————————————————————————————————————————————————————————— }
  1240. {  Menu Manager constants, etc.                                                         }
  1241. { —————————————————————————————————————————————————————————————————————————————————— }
  1242.     kMenuStdMenuProc            = 63;
  1243.     kMenuStdMenuBarProc            = 63;
  1244.  
  1245.     kMenuNoModifiers            = 0;                            {  Mask for no modifiers }
  1246.     kMenuShiftModifier            = $01;                            {  Mask for shift key modifier }
  1247.     kMenuOptionModifier            = $02;                            {  Mask for option key modifier }
  1248.     kMenuControlModifier        = $04;                            {  Mask for control key modifier }
  1249.     kMenuNoCommandModifier        = $08;                            {  Mask for no command key modifier }
  1250.  
  1251.     kMenuNoIcon                    = 0;                            {  No icon }
  1252.     kMenuIconType                = 1;                            {  Type for ICON }
  1253.     kMenuShrinkIconType            = 2;                            {  Type for ICON plotted 16 x 16 }
  1254.     kMenuSmallIconType            = 3;                            {  Type for SICN }
  1255.     kMenuColorIconType            = 4;                            {  Type for cicn }
  1256.     kMenuIconSuiteType            = 5;                            {  Type for Icon Suite }
  1257.     kMenuIconRefType            = 6;                            {  Type for Icon Ref }
  1258.  
  1259. { —————————————————————————————————————————————————————————————————————————————————— }
  1260. {     Appearance Manager APIs                                                             }
  1261. { —————————————————————————————————————————————————————————————————————————————————— }
  1262. {  Registering Appearance-Savvy Applications  }
  1263. FUNCTION RegisterAppearanceClient: OSStatus;
  1264.     {$IFC NOT GENERATINGCFM}
  1265.     INLINE $303C, $0015, $AA74;
  1266.     {$ENDC}
  1267. FUNCTION UnregisterAppearanceClient: OSStatus;
  1268.     {$IFC NOT GENERATINGCFM}
  1269.     INLINE $303C, $0016, $AA74;
  1270.     {$ENDC}
  1271. {
  1272. ****************************************************************************
  1273.     NOTES ON THEME BRUSHES
  1274.     Theme brushes can be either colors or patterns, depending on the theme.
  1275.     Because of this, you should be prepared to handle the case where a brush
  1276.     is a pattern and save and restore the pnPixPat and bkPixPat fields of
  1277.     your GrafPorts when saving the fore and back colors. Also, since patterns
  1278.     in bkPixPat override the background color of the window, you should use
  1279.     BackPat to set your background pattern to a normal white pattern. This
  1280.     will ensure that you can use RGBBackColor to set your back color to white,
  1281.     call EraseRect and get the expected results.
  1282. ****************************************************************************
  1283. }
  1284. FUNCTION SetThemePen(brush: ThemeBrush; depth: SInt16; colorDevice: BOOLEAN): OSStatus;
  1285.     {$IFC NOT GENERATINGCFM}
  1286.     INLINE $303C, $0001, $AA74;
  1287.     {$ENDC}
  1288. FUNCTION SetThemeBackground(brush: ThemeBrush; depth: SInt16; colorDevice: BOOLEAN): OSStatus;
  1289.     {$IFC NOT GENERATINGCFM}
  1290.     INLINE $303C, $0002, $AA74;
  1291.     {$ENDC}
  1292. FUNCTION SetThemeTextColor(color: ThemeTextColor; depth: SInt16; colorDevice: BOOLEAN): OSStatus;
  1293.     {$IFC NOT GENERATINGCFM}
  1294.     INLINE $303C, $0003, $AA74;
  1295.     {$ENDC}
  1296. FUNCTION SetThemeWindowBackground(window: WindowPtr; brush: ThemeBrush; update: BOOLEAN): OSStatus;
  1297.     {$IFC NOT GENERATINGCFM}
  1298.     INLINE $303C, $0004, $AA74;
  1299.     {$ENDC}
  1300. {  Window Placards, Headers and Frames  }
  1301. FUNCTION DrawThemeWindowHeader({CONST}VAR rect: Rect; state: ThemeDrawState): OSStatus;
  1302.     {$IFC NOT GENERATINGCFM}
  1303.     INLINE $303C, $0005, $AA74;
  1304.     {$ENDC}
  1305. FUNCTION DrawThemeWindowListViewHeader({CONST}VAR rect: Rect; state: ThemeDrawState): OSStatus;
  1306.     {$IFC NOT GENERATINGCFM}
  1307.     INLINE $303C, $0006, $AA74;
  1308.     {$ENDC}
  1309. FUNCTION DrawThemePlacard({CONST}VAR rect: Rect; state: ThemeDrawState): OSStatus;
  1310.     {$IFC NOT GENERATINGCFM}
  1311.     INLINE $303C, $0007, $AA74;
  1312.     {$ENDC}
  1313. FUNCTION DrawThemeEditTextFrame({CONST}VAR rect: Rect; state: ThemeDrawState): OSStatus;
  1314.     {$IFC NOT GENERATINGCFM}
  1315.     INLINE $303C, $0009, $AA74;
  1316.     {$ENDC}
  1317. FUNCTION DrawThemeListBoxFrame({CONST}VAR rect: Rect; state: ThemeDrawState): OSStatus;
  1318.     {$IFC NOT GENERATINGCFM}
  1319.     INLINE $303C, $000A, $AA74;
  1320.     {$ENDC}
  1321. {  Keyboard Focus Drawing  }
  1322. FUNCTION DrawThemeFocusRect({CONST}VAR rect: Rect; hasFocus: BOOLEAN): OSStatus;
  1323.     {$IFC NOT GENERATINGCFM}
  1324.     INLINE $303C, $000B, $AA74;
  1325.     {$ENDC}
  1326. {  Dialog Group Boxes and Separators  }
  1327. FUNCTION DrawThemePrimaryGroup({CONST}VAR rect: Rect; state: ThemeDrawState): OSStatus;
  1328.     {$IFC NOT GENERATINGCFM}
  1329.     INLINE $303C, $000C, $AA74;
  1330.     {$ENDC}
  1331. FUNCTION DrawThemeSecondaryGroup({CONST}VAR rect: Rect; state: ThemeDrawState): OSStatus;
  1332.     {$IFC NOT GENERATINGCFM}
  1333.     INLINE $303C, $000D, $AA74;
  1334.     {$ENDC}
  1335. FUNCTION DrawThemeSeparator({CONST}VAR rect: Rect; state: ThemeDrawState): OSStatus;
  1336.     {$IFC NOT GENERATINGCFM}
  1337.     INLINE $303C, $000E, $AA74;
  1338.     {$ENDC}
  1339. { —————————————————————————————————————————————————————————————————————————————————— }
  1340. {     Window Manager APIs                                                                 }
  1341. { —————————————————————————————————————————————————————————————————————————————————— }
  1342. FUNCTION GetWindowFeatures(window: WindowPtr; VAR features: UInt32): OSStatus;
  1343.     {$IFC NOT GENERATINGCFM}
  1344.     INLINE $303C, $0013, $AA74;
  1345.     {$ENDC}
  1346. FUNCTION IsWindowCollapsable(window: WindowPtr): BOOLEAN;
  1347.     {$IFC NOT GENERATINGCFM}
  1348.     INLINE $303C, $000F, $AA74;
  1349.     {$ENDC}
  1350. FUNCTION IsWindowCollapsed(window: WindowPtr): BOOLEAN;
  1351.     {$IFC NOT GENERATINGCFM}
  1352.     INLINE $303C, $0010, $AA74;
  1353.     {$ENDC}
  1354. FUNCTION CollapseWindow(window: WindowPtr; collapseIt: BOOLEAN): OSStatus;
  1355.     {$IFC NOT GENERATINGCFM}
  1356.     INLINE $303C, $0011, $AA74;
  1357.     {$ENDC}
  1358. FUNCTION CollapseAllWindows(collapseEm: BOOLEAN): OSStatus;
  1359.     {$IFC NOT GENERATINGCFM}
  1360.     INLINE $303C, $0012, $AA74;
  1361.     {$ENDC}
  1362. FUNCTION GetWindowRegion(window: WindowPtr; regionCode: WindowRegionCode; winRgn: RgnHandle): OSStatus;
  1363.     {$IFC NOT GENERATINGCFM}
  1364.     INLINE $303C, $0014, $AA74;
  1365.     {$ENDC}
  1366. { —————————————————————————————————————————————————————————————————————————————————— }
  1367. {     Dialog Manager APIs                                                                 }
  1368. { —————————————————————————————————————————————————————————————————————————————————— }
  1369. FUNCTION NewFeaturesDialog(wStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: ConstStr255Param; visible: BOOLEAN; procID: SInt16; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: SInt32; itmLstHndl: Handle; flags: UInt32): DialogPtr;
  1370.     {$IFC NOT GENERATINGCFM}
  1371.     INLINE $303C, $110C, $AA68;
  1372.     {$ENDC}
  1373. FUNCTION AutoSizeDialog(dialog: DialogPtr): OSErr;
  1374.     {$IFC NOT GENERATINGCFM}
  1375.     INLINE $303C, $020D, $AA68;
  1376.     {$ENDC}
  1377. FUNCTION StandardAlert(alertType: AlertType; error: StringPtr; explanation: StringPtr; alertParam: AlertStdAlertParamPtr; VAR itemHit: SInt16): OSErr;
  1378.     {$IFC NOT GENERATINGCFM}
  1379.     INLINE $303C, $090E, $AA68;
  1380.     {$ENDC}
  1381. FUNCTION GetDialogItemAsControl(dialog: DialogPtr; itemNo: SInt16; VAR control: ControlHandle): OSErr;
  1382.     {$IFC NOT GENERATINGCFM}
  1383.     INLINE $303C, $050F, $AA68;
  1384.     {$ENDC}
  1385. FUNCTION MoveDialogItem(dialog: DialogPtr; itemNo: SInt16; horiz: SInt16; vert: SInt16): OSErr;
  1386.     {$IFC NOT GENERATINGCFM}
  1387.     INLINE $303C, $0510, $AA68;
  1388.     {$ENDC}
  1389. FUNCTION SizeDialogItem(dialog: DialogPtr; itemNo: SInt16; height: SInt16; width: SInt16): OSErr;
  1390.     {$IFC NOT GENERATINGCFM}
  1391.     INLINE $303C, $0511, $AA68;
  1392.     {$ENDC}
  1393. { —————————————————————————————————————————————————————————————————————————————————— }
  1394. {     Control Manager APIs                                                             }
  1395. { —————————————————————————————————————————————————————————————————————————————————— }
  1396. {
  1397.  These routines are available only thru the shared library/glue
  1398.  Bevel button routines
  1399. }
  1400. FUNCTION GetBevelButtonMenuValue(button: ControlHandle; VAR value: SInt16): OSErr;
  1401. FUNCTION SetBevelButtonMenuValue(button: ControlHandle; value: SInt16): OSErr;
  1402. FUNCTION GetBevelButtonMenuHandle(button: ControlHandle; VAR handle: MenuHandle): OSErr;
  1403. FUNCTION GetBevelButtonContentInfo(button: ControlHandle; content: ControlButtonContentInfoPtr): OSErr;
  1404. FUNCTION SetBevelButtonContentInfo(button: ControlHandle; content: ControlButtonContentInfoPtr): OSErr;
  1405. FUNCTION SetBevelButtonTransform(button: ControlHandle; transform: IconTransformType): OSErr;
  1406. FUNCTION SetBevelButtonGraphicAlignment(button: ControlHandle; align: ControlButtonGraphicAlignment; hOffset: SInt16; vOffset: SInt16): OSErr;
  1407. FUNCTION SetBevelButtonTextAlignment(button: ControlHandle; align: ControlButtonTextAlignment; hOffset: SInt16): OSErr;
  1408. FUNCTION SetBevelButtonTextPlacement(button: ControlHandle; where: ControlButtonTextPlacement): OSErr;
  1409. {  Image well routines }
  1410. FUNCTION GetImageWellContentInfo(button: ControlHandle; content: ControlButtonContentInfoPtr): OSErr;
  1411. FUNCTION SetImageWellContentInfo(button: ControlHandle; content: ControlButtonContentInfoPtr): OSErr;
  1412. FUNCTION SetImageWellTransform(button: ControlHandle; transform: IconTransformType): OSErr;
  1413. {  Tab routines }
  1414. FUNCTION GetTabContentRect(tabControl: ControlHandle; VAR contentRect: Rect): OSErr;
  1415. FUNCTION SetTabEnabled(tabControl: ControlHandle; tabToHilite: SInt16; enabled: BOOLEAN): OSErr;
  1416. {  Disclosure triangles }
  1417. FUNCTION SetDisclosureTriangleLastValue(tabControl: ControlHandle; value: SInt16): OSErr;
  1418. {  Trap-based routines }
  1419. FUNCTION SendControlMessage(theControl: ControlHandle; message: SInt16; param: SInt32): SInt32;
  1420.     {$IFC NOT GENERATINGCFM}
  1421.     INLINE $303C, $FFFE, $AA73;
  1422.     {$ENDC}
  1423. FUNCTION DumpControlHierarchy(window: WindowPtr; {CONST}VAR outFile: FSSpec): OSErr;
  1424.     {$IFC NOT GENERATINGCFM}
  1425.     INLINE $303C, $FFFF, $AA73;
  1426.     {$ENDC}
  1427. FUNCTION CreateRootControl(window: WindowPtr; VAR control: ControlHandle): OSErr;
  1428.     {$IFC NOT GENERATINGCFM}
  1429.     INLINE $303C, $0001, $AA73;
  1430.     {$ENDC}
  1431. FUNCTION GetRootControl(window: WindowPtr; VAR control: ControlHandle): OSErr;
  1432.     {$IFC NOT GENERATINGCFM}
  1433.     INLINE $303C, $0002, $AA73;
  1434.     {$ENDC}
  1435. FUNCTION EmbedControl(control: ControlHandle; container: ControlHandle): OSErr;
  1436.     {$IFC NOT GENERATINGCFM}
  1437.     INLINE $303C, $0003, $AA73;
  1438.     {$ENDC}
  1439. FUNCTION AutoEmbedControl(control: ControlHandle; window: WindowPtr): OSErr;
  1440.     {$IFC NOT GENERATINGCFM}
  1441.     INLINE $303C, $0004, $AA73;
  1442.     {$ENDC}
  1443. FUNCTION IsControlActive(control: ControlHandle): BOOLEAN;
  1444.     {$IFC NOT GENERATINGCFM}
  1445.     INLINE $303C, $0005, $AA73;
  1446.     {$ENDC}
  1447. FUNCTION IsControlVisible(control: ControlHandle): BOOLEAN;
  1448.     {$IFC NOT GENERATINGCFM}
  1449.     INLINE $303C, $0006, $AA73;
  1450.     {$ENDC}
  1451. FUNCTION ActivateControl(control: ControlHandle): OSErr;
  1452.     {$IFC NOT GENERATINGCFM}
  1453.     INLINE $303C, $0007, $AA73;
  1454.     {$ENDC}
  1455. FUNCTION DeactivateControl(control: ControlHandle): OSErr;
  1456.     {$IFC NOT GENERATINGCFM}
  1457.     INLINE $303C, $0008, $AA73;
  1458.     {$ENDC}
  1459. FUNCTION FindControlUnderMouse(where: Point; window: WindowPtr; VAR part: SInt16): ControlHandle;
  1460.     {$IFC NOT GENERATINGCFM}
  1461.     INLINE $303C, $0009, $AA73;
  1462.     {$ENDC}
  1463. FUNCTION HandleControlClick(control: ControlHandle; where: Point; modifiers: SInt16; action: ControlActionUPP): SInt16;
  1464.     {$IFC NOT GENERATINGCFM}
  1465.     INLINE $303C, $000A, $AA73;
  1466.     {$ENDC}
  1467. FUNCTION HandleControlKey(control: ControlHandle; keyCode: SInt16; charCode: SInt16; modifiers: SInt16): SInt16;
  1468.     {$IFC NOT GENERATINGCFM}
  1469.     INLINE $303C, $000B, $AA73;
  1470.     {$ENDC}
  1471. PROCEDURE IdleControls(window: WindowPtr);
  1472.     {$IFC NOT GENERATINGCFM}
  1473.     INLINE $303C, $000C, $AA73;
  1474.     {$ENDC}
  1475. FUNCTION GetKeyboardFocus(window: WindowPtr; VAR control: ControlHandle): OSErr;
  1476.     {$IFC NOT GENERATINGCFM}
  1477.     INLINE $303C, $000D, $AA73;
  1478.     {$ENDC}
  1479. FUNCTION SetKeyboardFocus(window: WindowPtr; control: ControlHandle; part: ControlFocusPart): OSErr;
  1480.     {$IFC NOT GENERATINGCFM}
  1481.     INLINE $303C, $000E, $AA73;
  1482.     {$ENDC}
  1483. FUNCTION AdvanceKeyboardFocus(window: WindowPtr): OSErr;
  1484.     {$IFC NOT GENERATINGCFM}
  1485.     INLINE $303C, $000F, $AA73;
  1486.     {$ENDC}
  1487. FUNCTION ReverseKeyboardFocus(window: WindowPtr): OSErr;
  1488.     {$IFC NOT GENERATINGCFM}
  1489.     INLINE $303C, $0010, $AA73;
  1490.     {$ENDC}
  1491. FUNCTION GetControlFeatures(control: ControlHandle; VAR features: UInt32): OSErr;
  1492.     {$IFC NOT GENERATINGCFM}
  1493.     INLINE $303C, $0011, $AA73;
  1494.     {$ENDC}
  1495. FUNCTION SetControlData(control: ControlHandle; part: ControlPartCode; tagName: ResType; size: Size; data: Ptr): OSErr;
  1496.     {$IFC NOT GENERATINGCFM}
  1497.     INLINE $303C, $0012, $AA73;
  1498.     {$ENDC}
  1499. FUNCTION GetControlData(control: ControlHandle; part: ControlPartCode; tagName: ResType; bufferSize: Size; buffer: Ptr; VAR actualSize: Size): OSErr;
  1500.     {$IFC NOT GENERATINGCFM}
  1501.     INLINE $303C, $0013, $AA73;
  1502.     {$ENDC}
  1503. FUNCTION GetControlDataSize(control: ControlHandle; part: ControlPartCode; tagName: ResType; VAR maxSize: Size): OSErr;
  1504.     {$IFC NOT GENERATINGCFM}
  1505.     INLINE $303C, $0014, $AA73;
  1506.     {$ENDC}
  1507. FUNCTION GetSuperControl(control: ControlHandle; VAR parent: ControlHandle): OSErr;
  1508.     {$IFC NOT GENERATINGCFM}
  1509.     INLINE $303C, $0015, $AA73;
  1510.     {$ENDC}
  1511. FUNCTION CountSubControls(control: ControlHandle; VAR numChildren: SInt16): OSErr;
  1512.     {$IFC NOT GENERATINGCFM}
  1513.     INLINE $303C, $0016, $AA73;
  1514.     {$ENDC}
  1515. FUNCTION GetIndexedSubControl(control: ControlHandle; index: SInt16; VAR subControl: ControlHandle): OSErr;
  1516.     {$IFC NOT GENERATINGCFM}
  1517.     INLINE $303C, $0017, $AA73;
  1518.     {$ENDC}
  1519. PROCEDURE DrawControlInCurrentPort(theControl: ControlHandle);
  1520.     {$IFC NOT GENERATINGCFM}
  1521.     INLINE $303C, $0018, $AA73;
  1522.     {$ENDC}
  1523. FUNCTION ClearKeyboardFocus(window: WindowPtr): OSErr;
  1524.     {$IFC NOT GENERATINGCFM}
  1525.     INLINE $303C, $0019, $AA73;
  1526.     {$ENDC}
  1527. FUNCTION SetControlSupervisor(control: ControlHandle; boss: ControlHandle): OSErr;
  1528.     {$IFC NOT GENERATINGCFM}
  1529.     INLINE $303C, $001A, $AA73;
  1530.     {$ENDC}
  1531. FUNCTION GetBestControlRect(control: ControlHandle; VAR rect: Rect; VAR baseLineOffset: SInt16): OSErr;
  1532.     {$IFC NOT GENERATINGCFM}
  1533.     INLINE $303C, $001B, $AA73;
  1534.     {$ENDC}
  1535. FUNCTION SetControlFontStyle(control: ControlHandle; VAR style: ControlFontStyleRec): OSErr;
  1536.     {$IFC NOT GENERATINGCFM}
  1537.     INLINE $303C, $001C, $AA73;
  1538.     {$ENDC}
  1539. FUNCTION SetUpControlBackground(control: ControlHandle; depth: SInt16; colorDevice: BOOLEAN): OSErr;
  1540.     {$IFC NOT GENERATINGCFM}
  1541.     INLINE $303C, $001D, $AA73;
  1542.     {$ENDC}
  1543. FUNCTION SetControlVisibility(control: ControlHandle; isVisible: BOOLEAN; draw: BOOLEAN): OSErr;
  1544.     {$IFC NOT GENERATINGCFM}
  1545.     INLINE $303C, $001E, $AA73;
  1546.     {$ENDC}
  1547. { —————————————————————————————————————————————————————————————————————————————————— }
  1548. {     Menu Manager APIs                                                                 }
  1549. { —————————————————————————————————————————————————————————————————————————————————— }
  1550. FUNCTION MenuEvent({CONST}VAR event: EventRecord): UInt32;
  1551.     {$IFC NOT GENERATINGCFM}
  1552.     INLINE $303C, $020C, $A825;
  1553.     {$ENDC}
  1554. FUNCTION SetMenuItemCommandID(menu: MenuHandle; item: SInt16; commandID: UInt32): OSErr;
  1555.     {$IFC NOT GENERATINGCFM}
  1556.     INLINE $303C, $0502, $A825;
  1557.     {$ENDC}
  1558. FUNCTION GetMenuItemCommandID(menu: MenuHandle; item: SInt16; VAR commandID: UInt32): OSErr;
  1559.     {$IFC NOT GENERATINGCFM}
  1560.     INLINE $303C, $0503, $A825;
  1561.     {$ENDC}
  1562. FUNCTION SetMenuItemModifiers(menu: MenuHandle; item: SInt16; modifiers: ByteParameter): OSErr;
  1563.     {$IFC NOT GENERATINGCFM}
  1564.     INLINE $303C, $0404, $A825;
  1565.     {$ENDC}
  1566. FUNCTION GetMenuItemModifiers(menu: MenuHandle; item: SInt16; VAR modifiers: UInt8): OSErr;
  1567.     {$IFC NOT GENERATINGCFM}
  1568.     INLINE $303C, $0505, $A825;
  1569.     {$ENDC}
  1570. FUNCTION SetMenuItemIconHandle(menu: MenuHandle; item: SInt16; iconType: ByteParameter; icon: Handle): OSErr;
  1571.     {$IFC NOT GENERATINGCFM}
  1572.     INLINE $303C, $0606, $A825;
  1573.     {$ENDC}
  1574. FUNCTION GetMenuItemIconHandle(menu: MenuHandle; item: SInt16; VAR iconType: UInt8; VAR icon: Handle): OSErr;
  1575.     {$IFC NOT GENERATINGCFM}
  1576.     INLINE $303C, $0707, $A825;
  1577.     {$ENDC}
  1578. FUNCTION SetMenuItemTextEncoding(menu: MenuHandle; item: SInt16; scriptID: TextEncoding): OSErr;
  1579.     {$IFC NOT GENERATINGCFM}
  1580.     INLINE $303C, $0408, $A825;
  1581.     {$ENDC}
  1582. FUNCTION GetMenuItemTextEncoding(menu: MenuHandle; item: SInt16; VAR scriptID: TextEncoding): OSErr;
  1583.     {$IFC NOT GENERATINGCFM}
  1584.     INLINE $303C, $0509, $A825;
  1585.     {$ENDC}
  1586. FUNCTION SetMenuItemHierarchicalID(menu: MenuHandle; item: SInt16; hierID: SInt16): OSErr;
  1587.     {$IFC NOT GENERATINGCFM}
  1588.     INLINE $303C, $040D, $A825;
  1589.     {$ENDC}
  1590. FUNCTION GetMenuItemHierarchicalID(menu: MenuHandle; item: SInt16; VAR hierID: SInt16): OSErr;
  1591.     {$IFC NOT GENERATINGCFM}
  1592.     INLINE $303C, $050E, $A825;
  1593.     {$ENDC}
  1594. FUNCTION SetMenuItemFontID(menu: MenuHandle; item: SInt16; fontID: SInt16): OSErr;
  1595.     {$IFC NOT GENERATINGCFM}
  1596.     INLINE $303C, $040F, $A825;
  1597.     {$ENDC}
  1598. FUNCTION GetMenuItemFontID(menu: MenuHandle; item: SInt16; VAR fontID: SInt16): OSErr;
  1599.     {$IFC NOT GENERATINGCFM}
  1600.     INLINE $303C, $0510, $A825;
  1601.     {$ENDC}
  1602. FUNCTION SetMenuItemRefCon(menu: MenuHandle; item: SInt16; refCon: UInt32): OSErr;
  1603.     {$IFC NOT GENERATINGCFM}
  1604.     INLINE $303C, $050A, $A825;
  1605.     {$ENDC}
  1606. FUNCTION GetMenuItemRefCon(menu: MenuHandle; item: SInt16; VAR refCon: UInt32): OSErr;
  1607.     {$IFC NOT GENERATINGCFM}
  1608.     INLINE $303C, $050B, $A825;
  1609.     {$ENDC}
  1610. FUNCTION SetMenuItemRefCon2(menu: MenuHandle; item: SInt16; refCon2: UInt32): OSErr;
  1611.     {$IFC NOT GENERATINGCFM}
  1612.     INLINE $303C, $0511, $A825;
  1613.     {$ENDC}
  1614. FUNCTION GetMenuItemRefCon2(menu: MenuHandle; item: SInt16; VAR refCon2: UInt32): OSErr;
  1615.     {$IFC NOT GENERATINGCFM}
  1616.     INLINE $303C, $0512, $A825;
  1617.     {$ENDC}
  1618. FUNCTION SetMenuItemKeyGlyph(menu: MenuHandle; item: SInt16; glyph: SInt16): OSErr;
  1619.     {$IFC NOT GENERATINGCFM}
  1620.     INLINE $303C, $0513, $A825;
  1621.     {$ENDC}
  1622. FUNCTION GetMenuItemKeyGlyph(menu: MenuHandle; item: SInt16; VAR glyph: SInt16): OSErr;
  1623.     {$IFC NOT GENERATINGCFM}
  1624.     INLINE $303C, $0514, $A825;
  1625.     {$ENDC}
  1626. {$ALIGN RESET}
  1627. {$POP}
  1628.  
  1629. {$SETC UsingIncludes := AppearanceIncludes}
  1630.  
  1631. {$ENDC} {__APPEARANCE__}
  1632.  
  1633. {$IFC NOT UsingIncludes}
  1634.  END.
  1635. {$ENDC}
  1636.